{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
  <div class="tpt-admin">
    <fieldset class="layui-elem-field layui-field-title">
      <legend>添加采集器</legend>
    </fieldset>
    <form class="layui-form">
      <!-- 采集器名称 -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集器名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 入库分类 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">入库分类</label>
        <div class="layui-input-block">
            <select name="cid">
            {volist name="CategoryList" id="vo"}
              {if condition="$vo.open eq 1"}
                <option value="{$vo.id}">{$vo.name}</option>
              {/if}
            {/volist}
            </select>
        </div>
      </div>
      <!-- 关键词 -->
      <div class="layui-form-item">
        <label class="layui-form-label">关键词</label>
        <div class="layui-input-block">
          <input type="text" name="keyword" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 采集分类ID -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集分类ID</label>
        <div class="layui-input-block">
          <input type="text" name="catIds" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 排序方式 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">排序方式</label>
        <div class="layui-input-block">
            <select name="sort">
              <option value=" ">综合排序</option>
              <option value="1">收入比率从高到低</option>
              <option value="7">月支出佣金从高到低</option>
              <option value="5">月推广量从高到低</option>
              <option value="9">销量从高到低</option>
              <option value="3">价格从高到低</option>
              <option value="4">价格从低到高</option>
            </select>
        </div>
      </div>  
      <!-- 包邮 -->
      <div class="layui-form-item">
        <label class="layui-form-label">包邮</label>
        <div class="layui-input-block">
          <input type="radio" name="freeShipment" value="1" title="包邮">
          <input type="radio" name="freeShipment" value="" title="不限" checked="">
        </div>
      </div>
      <!-- 天猫 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">天猫</label>
        <div class="layui-input-block">
            <select name="userType">
              <option value=" ">不限</option>
              <option value="b2c">天猫</option>
            </select>
        </div>
      </div>         
      <!-- 价格限制 -->
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">价格</label>
          <div class="layui-input-inline" style="width: 150px;">
            <input type="text" name="startPrice" placeholder="￥" autocomplete="off" class="layui-input">
          </div>
          <div class="layui-form-mid"> - </div>
          <div class="layui-input-inline" style="width: 150px;">
            <input type="text" name="endPrice" placeholder="￥" autocomplete="off" class="layui-input">
          </div>          
        </div>
      </div>
      <!-- 佣金百分比限制 -->
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">佣金百分比</label>
          <div class="layui-input-inline" style="width: 150px;">
            <input type="text" name="startTkRate" value="5" autocomplete="off" class="layui-input">
          </div>
          <div class="layui-form-mid"> - </div>
          <div class="layui-input-inline" style="width: 150px;">
            <input type="text" name="endTkRate" value="90" autocomplete="off" class="layui-input">
          </div>          
        </div>
      </div>
      <!-- 商品月销量 -->
      <div class="layui-form-item">
        <label class="layui-form-label">商品月销量</label>
        <div class="layui-input-block">
          <input type="text" name="startBiz30day" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 图片牛皮廯 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">图片牛皮廯</label>
        <div class="layui-input-block">
            <select name="npxType">
              <option value=" ">不限</option>
              <option value="2">图片轻微牛皮廯</option>
              <option value="1">图片无牛皮廯</option>
            </select>
        </div>
      </div> 
      <!-- 图片质量 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">图片质量</label>
        <div class="layui-input-block">
            <select name="picQuality">
              <option value=" ">不限</option>
              <option value="1">中等质量图片</option>
              <option value="2">高质量图片</option>
            </select>
        </div>
      </div>           
      <!-- 所属类型 -->
      <div class="layui-form-item">
        <label class="layui-form-label">所属类型</label>
        <div class="layui-input-block">
          <input type="radio" name="type" value="1" title="优惠卷" checked="">
          <input type="radio" name="type" value="2" title="不限" disabled="">
        </div>
      </div>
      <!-- 采集页数 -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集页数</label>
        <div class="layui-input-block">
    	    <input type="text" name="page" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
    	  <button class="layui-btn" lay-submit="" lay-filter="robotalimama_add">立即提交</button>
          <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
        </div>
      </div>
    </form>
  </div>
</div>
{include file="index_footer"}
<script type="text/javascript">
layui.use(['form'],function(){
  var form = layui.form()
  ,jq = layui.jquery;
  
  form.on('submit(robotalimama_add)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("robotalimama/add")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("robotalimama/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
})
</script>
</body>
</html>